<#--登录-->
<#macro main_title title="信息管理系统">
<title>${h_system_name}</title>
<#--<@_getCache cachename="system" key="system_name">-->
<#--<title>${obj.value}</title>-->
<#--</@_getCache>-->
</#macro>

<#--
打印jsonView对象
-->
<#macro printJsonView jsonView>
    <#if jsonView>
    <div class="row">
        <div class="col-md-12">
            <#if jsonView.status>
                <div class="alert alert-success alert-dismissable">
                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true"></button>
                    <i class="fa fa-check"></i><strong>${jsonView.msg}</strong>
                </div>
            <#else>
                <div class="alert alert-danger alert-dismissable">
                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true"></button>
                    <i class="fa fa-exclamation-triangle"></i><strong>${jsonView.msg}</strong>
                </div>
            </#if>
        </div>
    </div>
    </#if>
</#macro>


<#--面包屑-->
<#macro breadcrumb view>
<div class="row">
    <@themetool/>
    <div class="col-md-12">

        <!-- BEGIN PAGE TITLE & BREADCRUMB-->
        <#--<h3 class="page-title">-->
        <#--${view.getTitlename()!}-->
            <#--<small>${view.smalltitle!}</small>-->
        <#--</h3>-->
        <ul class="page-breadcrumb breadcrumb">
            <#list view.getNodelist() as item>
                <li>
                    <#if item_index==0>
                        <i class="fa ${item.uiicon}"></i>
                    </#if>
                    <a href="${CONTEXT_PATH}${item.url}">${item.name}</a>
                    <#if view.getNodelist().size()!=(item_index+1)>
                        <i class="fa fa-angle-right"></i>
                    </#if>
                </li>
            </#list>
        </ul>
        <!-- END PAGE TITLE & BREADCRUMB-->
    </div>
</div>

</#macro>


<#--全局引入资源文件-->
<#macro globalJS>
<!--工具-->
<script src="${CONTEXT_PATH}/js/utils.js" type="text/javascript"></script>

</#macro>


<#--curd用的弹出层（ajax）
    id:容器id
    css: modal-wide|modal-full
    确认事件 写于utils.js中
-->
<#macro Modal_CURD id="" css="" formid="" >
<div class="modal fade" id="${id}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     aria-hidden="true">
    <div class="modal-dialog ${css}">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span
                        aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" id="myModalLabel">操作</h4>
            </div>
            <div class="modal-body">
                <#nested />
            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-primary" form="${formid}">确认</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>
</#macro>


<#--系统提示-->
<#macro Modal_SystemOpera >
<div class="modal fade" id="system_modal" tabindex="-1" role="basic" aria-hidden="true"
     style="display: none;">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title">系统提示</h4>
            </div>
            <div class="modal-body">
            ${msg}
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-success">确认</button>
                <button type="button" class="btn default" data-dismiss="modal">取消</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
</#macro>

<#--
    用户选择宏
    /**主意**/
    /* 调用页面需增加select_user_callback函数 */
    function select_user_callback(str){
            console.debug(str);
    }

-->
<#macro select_user id="select_user">
<div class="modal fade" id="${id}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span
                        aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" id="myModalLabel">操作</h4>
            </div>
            <div class="modal-body">
                <iframe height="400" src="javascript:;" frameBorder="0" width="100%"
                        name="s_user_load"></iframe>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary">确认</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        var Plugin_SelectUser = {
            callback: function (v) {
                console.debug(v);
            }
        };
        $("#select_user").ready(function () {
            /* 注册启动事件,modal渲染完毕后 加载iframe内容 */
            $('#select_user').on('shown.bs.modal', function (e) {
                $('#select_user').find("iframe").attr("src", "${CONTEXT_PATH}/plugin/s/user_info");
            });
            /* 注册 确定按钮事件,单击后 将值传入Plugin_SelectUser 回调事件,调用页需要重写.*/
            $('#select_user').find(".btn-primary").click(function () {
                var v = "";
                $("input:checkbox[name='s_users']:checked", window.frames["s_user_load"].document).each(function () {
                    v += ";" + this.value;
                });
                Plugin_SelectUser.callback.call(this, v);
                $('#select_user').modal("hide");
            });
        });
    </script>
</div>
</#macro>



<#macro frameModel id="frameModel">
<div class="modal fade" id="${id}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span
                        aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" id="myModalLabel">操作</h4>
            </div>
            <div class="modal-body">
                <iframe height="400" src="javascript:;" frameBorder="0" width="100%"
                        name="s_user_load"></iframe>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary">确认</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        var FrameSetting = {
            url: "",
            callback: function (v) {
                console.debug(v);
            }
        };
        var selector = "${id}"
        $("#" + selector).ready(function () {
            /* 注册启动事件,modal渲染完毕后 加载iframe内容 */
            $('#' + selector).on('shown.bs.modal', function (e) {
                $('#' + selector).find("iframe").attr("src", FrameSetting.url);
            });
            /* 注册 确定按钮事件,单击后 将值传入Plugin_SelectUser 回调事件,调用页需要重写.*/
            $('#' + selector).find(".btn-primary").click(function () {
                FrameSetting.callback.call(this);
                $('#' + selector).modal("hide");
            });
        });
    </script>
</div>
</#macro>

<#--
    阿姨选择宏
    /**主意**/
    /* 调用页面需增加select_user_callback函数 */
    function select_user_callback(str){
            console.debug(str);
    }

-->
<#macro select_aunties id="select_aunties">
<div class="modal fade" id="${id}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span
                        aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" id="myModalLabel">操作</h4>
            </div>
            <div class="modal-body">
                <iframe height="400" src="javascript:;" frameBorder="0" width="100%"
                        name="s_aunties_load"></iframe>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary">确认</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        var Plugin_SelectAunties = {
            callback: function (v) {
                console.debug(v);
            }
        };
        $("#select_aunties").ready(function () {
            /* 注册启动事件,modal渲染完毕后 加载iframe内容 */
            $('#select_aunties').on('shown.bs.modal', function (e) {
                $('#select_aunties').find("iframe").attr("src", "${CONTEXT_PATH}/plugin/s/auntie_info");
            });
            /* 注册 确定按钮事件,单击后 将值传入Plugin_SelectUser 回调事件,调用页需要重写.*/
            $('#select_aunties').find(".btn-primary").click(function () {
                var v;
                $("input:checkbox[name='s_users']:checked", window.frames["s_aunties_load"].document).each(function () {
                    v += ";" + this.value;
                });
                Plugin_SelectAunties.callback.call(this, v);
                $('#select_aunties').modal("hide");
            });
        });
    </script>
</div>
</#macro>







<#--底部 footer-->
<#macro footer>
<!--footer begin-->
<div class="footer">
    <div class="footer-inner">
    ${h_system_main_footer}
        <#--<@_getCache cachename="system" key="system_main_footer">-->
            <#--${obj.value}-->
        <#--</@_getCache>-->
    </div>
    <div class="footer-tools">
      <span class="go-top">
      <i class="fa fa-angle-up"></i>
      </span>
    </div>
</div>
<!--footer end-->
</#macro>


<#--样式工具-->
<#macro themetool>
<div class="theme-panel hidden-xs hidden-sm">
    <div class="toggler" style="display: block;"></div>
    <div class="toggler-close" style="display: none;"></div>
    <div class="theme-options" style="display: none;">
        <div class="theme-option theme-colors clearfix">
            <span>样式工具</span>
            <ul>
                <li class="color-black current color-default" data-style="default"></li>
                <li class="color-blue" data-style="blue"></li>
                <li class="color-brown" data-style="brown"></li>
                <li class="color-purple" data-style="purple"></li>
                <li class="color-grey" data-style="grey"></li>
                <li class="color-white color-light" data-style="light"></li>
            </ul>
        </div>
        <div class="theme-option">
            <span>Layout</span>
            <select class="layout-option form-control input-small">
                <option value="fluid" selected="selected">Fluid</option>
                <option value="boxed">Boxed</option>
            </select>
        </div>
        <div class="theme-option">
            <span>Header</span>
            <select class="header-option form-control input-small">
                <option value="fixed" selected="selected">Fixed</option>
                <option value="default">Default</option>
            </select>
        </div>
        <div class="theme-option">
            <span>Sidebar</span>
            <select class="sidebar-option form-control input-small">
                <option value="fixed" >Fixed</option>
                <option value="default" selected="selected">Default</option>
            </select>
        </div>
        <div class="theme-option">
            <span>Footer</span>
            <select class="footer-option form-control input-small">
                <option value="fixed" selected="selected">Fixed</option>
                <option value="default" >Default</option>
            </select>
        </div>
    </div>
</div>
</#macro>

<#--
    topBar导航条
-->
<#macro topMenu view=breadcrumbView>
<!-- BEGIN HEADER -->
<div class="header navbar navbar-inverse navbar-fixed-top">
    <!-- BEGIN TOP NAVIGATION BAR -->
    <div class="header-inner">
        <!-- BEGIN LOGO -->
        <a style="float: left;padding: 10px 0px 5px 10px;font-size: 18px;line-height: 20px;color:white;text-decoration:none; "
           href="${CONTEXT_PATH}">
            ${view.getTitlename()!} <sub style="color: grey;"><i>${view.smalltitle!}</i></sub>
        </a>
        <!-- END LOGO -->
        <!-- BEGIN RESPONSIVE MENU TOGGLER -->
        <a href="javascript:;" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
           <img src="${CONTEXT_PATH}/plugin/assets/img/menu-toggler.png" alt=""/>
        </a>
        <!-- END RESPONSIVE MENU TOGGLER -->

        <!-- BEGIN TOP NAVIGATION MENU -->
        <ul class="nav navbar-nav pull-right">
            <!-- BEGIN USER LOGIN DROPDOWN -->
            <li class="dropdown user">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown"
                   data-close-others="true">
                    <#if h_user_img == "null">
                        <img alt="" src="${CONTEXT_PATH}/plugin/assets/img/avatar.png" height="28px" width="28px"/>
                    <#else>
                        <img alt="" src="${CONTEXT_PATH}${h_user_img}" height="28px" width="28px"/>
                    </#if>
                <#--从InitTableDictCacheHandler中取值h_user_name-->
                    <span class="username">${h_user_name}</span>
                    <i class="icon-angle-down"></i>
                </a>
                <ul class="dropdown-menu">
                    <li><a href="#"><i class="fa fa-user"></i> 我的信息</a>
                    </li>
                <#--<li><a href="page_calendar.html"><i class="fa fa-calendar"></i> My Calendar</a>-->
                <#--</li>-->
                <#--<li><a href="inbox.html"><i class="fa fa-envelope"></i> My Inbox <span class="badge badge-danger">3</span></a>-->
                <#--</li>-->
                <#--<li><a href="#"><i class="fa fa-tasks"></i> 我的任务 <span class="badge badge-success">7</span></a>-->
                <#--</li>-->
                    <li class="divider"></li>
                    <li><a href="javascript:;" id="trigger_fullscreen"><i class="fa fa-desktop"></i> 全屏模式</a>
                    </li>
                    <li><a href="${CONTEXT_PATH}/login/lock"><i class="fa fa-lock"></i> 锁定屏幕</a>
                    </li>
                    <li><a href="${CONTEXT_PATH}/login/logout"><i class="fa fa-key"></i> 退出登录</a>
                    </li>
                </ul>
            </li>
            <!-- END USER LOGIN DROPDOWN -->
        </ul>
        <!-- END TOP NAVIGATION MENU -->
    </div>
    <!-- END TOP NAVIGATION BAR -->
</div>
<!-- END HEADER -->
</#macro>


<#macro curdToolBar bar=[]>
<div class="well well-sm" style="margin: 10px;">
    <#list bar as item>
        <#if item=="add">
            <a href="#" class="btn red" onclick="deletebatch(this)"><i class="fa fa-minus-circle"></i> 批量删除</a>
        </#if>
        <#if item=="batchdelete">
        <a href="#" class="btn red" onclick="deletebatch(this)"><i class="fa fa-minus-circle"></i> 批量删除</a>
        </#if>
    </#list>
    <#nested >
</div>
</#macro>